﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/group/GroupMasterPage.Master"
    AutoEventWireup="true" CodeBehind="MySettings.aspx.cs" Inherits="Yonkly.Views.Group.MySettings" %>

<%@ Import Namespace="Yonkly" %>
<%@ Import Namespace="Yonkly.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <h2>
        <%=((GroupViewData)ViewData.Model).GroupInfo.Name %></h2>
    <div id="divGroupSettings">
        <div class="form">
            <h2>
                Group Settings</h2>
            <p>
                Notify me by email when:<br />
                <br />
                <input type="checkbox" name="notifyOnMessage" id="notifyOnMessage" <%= ((GroupViewData)ViewData.Model).MyGroupSettings().NotifyOnMessage.ToCheckboxChecked() %> />a
                message is posted to the group
                <br />
                <input type="checkbox" name="notifyOnReply" id="notifyOnReply" <%= ((GroupViewData)ViewData.Model).MyGroupSettings().NotifyOnReply.ToCheckboxChecked() %> />someone
                replies to my message
                <br />
                <br />
                <input type="checkbox" name="notifyOnJoin" id="notifyOnJoin" <%= ((GroupViewData)ViewData.Model).MyGroupSettings().NotifyOnJoin.ToCheckboxChecked() %> />a
                member joins the group
                <br />
                <input type="checkbox" name="notifyOnLeave" id="notifyOnLeave" <%= ((GroupViewData)ViewData.Model).MyGroupSettings().NotifyOnLeave.ToCheckboxChecked() %> />a
                member leaves the group
                <% if (((GroupViewData)ViewData.Model).MyGroupRole == GroupMemberRoles.Owner)
                   {%>
                <br />
                <br />
                <input type="checkbox" name="notifyOnPending" id="notifyOnPending" <%= ((GroupViewData)ViewData.Model).MyGroupSettings().NotifyOnPending.ToCheckboxChecked() %> />there
                is pending request to join the group
                <%} %>
                <br />
                <div id="infoMessage" class="message" style="display: none">
                </div>
                <p>
                    <input id="btnSubmit" type="button" class="button" value="save settings" onclick='javascript:Group.saveSettings("<%=((GroupViewData)ViewData.Model).GroupInfo.Url %>",<%=((GroupViewData)ViewData.Model).GroupInfo.Id %>, "<%=((GroupViewData)ViewData.Model).LoggedInUser.UserId %>")' />
                </p>
            </p>
        </div>
    </div>
</asp:Content>
